package com.jyniubi.sms.controller;

import com.jyniubi.base.result.R;
import com.jyniubi.sms.service.SmsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@Api(tags = "短信模块")
@RestController

@RequestMapping("/admin/sms")
public class SmsController {
    @Resource
    private SmsService smsService;
    @ApiOperation("发送短信验证码")
    @GetMapping("/sendSms/{phone}")
    public R sendMsg(@PathVariable("phone")String phone){
        //todo:可以将短信内容、手机号、验证码写入数据库表中。
        smsService.sendSms(phone);
        return R.ok();
    }
}
